#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
print(random.random())
print(random.randint(1,6))#包含6
print(random.choice(['a','b','c']))
print(random.choice('abcdef'))
print(random.randrange(0,10))#范围
print(random.sample([1,2,3,4,5,6,7,8],3))#随机选择N个


#生成验证码
checkcode = ""
for i in range(5):
    if i == random.randrange(0,5):
        temp = chr(random.randint(65,90))
    else:
        temp = random.randint(0,9)
    checkcode += str(temp)
print(checkcode)

#第二种
checkcode = ""
for i in range(5):
    temp = random.choice([chr(random.randint(65,90)),random.randint(0,9)])
    checkcode += str(temp)
print(checkcode)
